package com.yz.xyt.controller;

import com.github.pagehelper.PageInfo;
import com.yz.xyt.constant.HttpStatus;
import com.yz.xyt.domain.Department;
import com.yz.xyt.domain.ResponseResult;
import com.yz.xyt.domain.vo.ClazzVo;
import com.yz.xyt.domain.vo.DepartmentVo;
import com.yz.xyt.service.IDepartmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 部门管理
 */
@RestController
@RequestMapping("/system")
public class DepartmentManagerController {

    @Autowired
    IDepartmentService departmentService;

    /**
     * 查询部门名列表
     * @param departmentVo
     * @return
     */
    @RequestMapping("/getDepartmentList")
    public ResponseResult getDepartmentList(DepartmentVo departmentVo){
        ResponseResult result = new ResponseResult();
        List<Department> departmentList = departmentService.findDepartmentList(departmentVo);
        result.setCode(HttpStatus.SUCCESS);
        result.setMsg("部门查询成功");
        result.setData(departmentList);
        return result;
    }
}
